<?php

Route::group(['prefix' => 'power'], function () {
    //后台页面列表
    /** @var \Xy\Rbac\Controllers\RbacPowerPageController */
    Route::get('/page', 'RbacPowerPageController@index');
    Route::post('', 'RbacPowerPageController@store');
    Route::put('/{id}', 'RbacPowerPageController@update')->where('id', '[0-9]+');
    Route::delete('/{id}', 'RbacPowerPageController@destroy')->where('id', '[0-9]+');
    Route::get('/user-permission', 'RbacPowerPageController@userPermission');
});

Route::group(['prefix' => 'role'], function () {
    /** @var \Xy\Rbac\Controllers\RbacRoleController */
    Route::post('/page', 'RbacRoleController@getPage');
    
    Route::get('', 'RbacRoleController@index');
    Route::post('', 'RbacRoleController@store');
    Route::put('/{id}', 'RbacRoleController@update')->where('id', '[0-9]+');
    Route::put('/{id}/assign-role-power-page', 'RbacRoleController@assignRolePowerPage')->where('id', '[0-9]+');
    Route::delete('/{id}', 'RbacRoleController@destroy')->where('id', '[0-9]+');
});

Route::group(['prefix' => 'user'], function () {
    /** @var \Xy\Rbac\Controllers\RbacUserController */
    Route::post('/page', 'RbacUserController@getPage');
    Route::get('/{id}/role-ids', 'RbacUserController@getUserRoleIdList');
    Route::put('/{id}/role', 'RbacUserController@assignRole');
});


